<template>
        <div>
                <van-nav-bar title="我的收货地址"
                             left-text="返回"
                             right-text="新增地址"
                             left-arrow
                             @click-left="$router.go(-1)" />
                <div class="top1"
                     v-for="(item,index) in addresslist"
                     :key="index">
                        <div>
                                <h4>{{item.address}}</h4>
                                <span>{{item.name}}</span>
                                <span>{{item.phone}}</span>
                        </div>
                        <div>
                                <van-icon name="edit"
                                          size="23px" />
                        </div>
                </div>
        </div>
</template>

<script>
import { address_list } from "../utils/api"
export default {
        data () {
                return {
                        addresslist: []

                }
        },
        mounted () {
                var userid = JSON.parse(localStorage.getItem('userinfo')).id;
                address_list({ userid }).then((ok) => {
                        console.log(ok.data.list)
                        this.addresslist = ok.data.list

                })
        }

}
</script>

<style lang="scss" scoped>
.top1 {
        display: flex;
        justify-content: space-around;
        padding: 15px 0;
}
</style>